package center

import (
	"gitee.com/game_diamond/consts"
	"gitee.com/game_diamond/protocols"
	"gitee.com/game_diamond/server"
	"gitee.com/game_diamond/session"
	"gitee.com/game_diamond/srvws/common"
)

//大厅
func init() {
	server.RegisterWsScene(consts.ActorStudent, consts.SceneStudentCourseList, SceneStudentCenter)
}

func SceneStudentCenter(studentId int) {
	gl := session.GetGlobalStudentSession(studentId)
	gl.SceneId = consts.SceneStudentCourseList
	gl.Save()
	classId := gl.ClassId

	//get list
	body := &protocols.WebSocketBody{
		Data: map[string]int{
			"classId": classId,
		},
	}
	common.SendMessageToUser(0, body, studentId)
}
